<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>demo</title>
</head>
<body>
  <div id="root"></div>
  <script src="../../node_modules/react/umd/react.development.js"></script>
  <script src="../../node_modules/react-dom/umd/react-dom.development.js"></script>
  <script>
    // 组件：组件是页面上的一部分
    function HiButton() {
      return React.createElement('button', {
        onClick:() => { alert('hello')}
      }, 'sayHello')
    }
    // 获取一个页面根节点
    const rootNode = document.getElementById('root');
    // 创建一个 React 根实例
    const root = ReactDOM.createRoot(rootNode);
    // 使用跟实例渲染一个组件
    root.render(React.createElement(HiButton));
  </script>
</body>
</html>

